<script>
	function showHideFaqAnswer(id){
	
		$(document).ready(function() {
			var text = $("#faqAsk"+id).text();
			$(".faq_answer").slideUp(160);
			
			if($("#answer_"+id).is(":hidden")) {
				$("#answer_"+id).slideDown(160);
			}
			else {
				$("#answer_"+id).slideUp(160);
			}
		});
	}
</script>

<?php
// ici on affiche un texte en hut de la page pour le changer c'esty dans modules/message_haut.php
echo '' . Faq . '';


/*
	Faq by infoxp
*/

	$req = $pdo->query("SELECT faq_id,faq_ask,faq_answer FROM forum_faqs");
	if($req->rowCount() > 0){
		while($faq = $req->fetch(PDO::FETCH_OBJ)){	
			echo code("<question> </question>") . "<a onClick=\"showHideFaqAnswer(".intval($faq->faq_id).");\" style=\"cursor:pointer;\" id=\"faqAsk".intval($faq->faq_id)."\"><span class=\"info\"><strong>" . $faq->faq_ask . "</strong></span> [Cliquez pour voir/cacher]</a>";
			echo "<div style=\"display:none;\" class=\"faq_answer\" id=\"answer_".intval($faq->faq_id)."\">" . nl2br(code($faq->faq_answer)) . "</div>";
			echo "<br />";
		}
	}else
		echo display_info("La faq ne contient pas de Q/R pour le moment !",ERROR);
?>